package com.mmm.station.service;

import com.mmm.station.entity.User;
import com.mmm.station.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by mmm on 2016/11/8.
 */
@CacheConfig(cacheNames = "user")
@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    @Cacheable
    public List<User> SelectList() {

        return userDao.selectList();
    }

    @CacheEvict(value="user", allEntries=true)
    public void insertUser(){
        System.out.println("更新user");
    }


}
